<?php
	header("Content-Type: text/html;charset=utf-8");
	include("function/_nosql.php"); //
	include("function/function.php");
	$kboy_userid = $_SESSION['kboy_userid'];
	$kboy_user = $_SESSION['kboy_user'];
	
	$uid = chkstr(trim($_REQUEST['uid']));
	if(empty($uid)){
		echo erro("参数错误");
	}
	if(!is_numeric($uid)){
		echo erro("参数错误");
	}
	if(getNewsNums("kboy_user","uid=$uid") <1){
		echo erro("参数错误");
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>我的游记_社区_<?= $web_titles ?></title>
<meta name="Keywords" content="我的游记,社区,<?= $web_keywords ?>" />
<meta name="Description" content="<?= $web_description ?>" />
<link rel="stylesheet" href="css/common.css"/>
<link rel="stylesheet" href="css/sq.css"/>
<script type="text/javascript" src="js/baidutongji.js"></script>
<script type="text/javascript" src="js/laydate/laydate.js"></script>
</head>
<body>
    <!--top-bar begin-->
	<? include("_include.top.topbar.php") ?>
    <!--top-bar end-->
    <!--header begin-->
	<? include("_include.top.navbar.php") ?>
    <!--header end-->
    <!--banner begin-->
	<? include("_include.forum.banners.php") ?>
    <!--banner end-->
    <!--活动 begin-->
    <div class="sq-wrap">
		<? include("_include.forum.title.php") ?>
        <div class="sq-bd">
			<? include("_include.forum.topnav.php") ?>
            <div class="sq-bd-con">
                <div class="sq-bd-l">
                    <div class="travel-wrap">
					
					
                        <div class="travel-hd">
                            <div class="title"><a href="forum_travel.php?uid=<?=$uid?>"><?php if($_SESSION['kboy_userid'] == $uid) {?>我<?php }else{ ?>ta<?php } ?>的游记</a>&nbsp;&nbsp;&nbsp;<a href="forum_travel_favorite.php?uid=<?=$uid?>"><?php if($_SESSION['kboy_userid'] == $uid) {?>我<?php }else{ ?>ta<?php } ?>收藏的游记</a></div>
                            <div class="yj-num"><span><?=getNewsNums("kboy_forum_travel","uid=$uid")?></span>篇游记</div>
					<?php
							if($kboy_userid == $uid){
					?>
                            <div class="write-yj"><a href="forum_travel_add.php?uid=<?=$uid?>">写游记</a></div>
					<?php
							}
					?>
                        </div>


					
					
                        <div class="travel-list">
						<?php
								$SQL = "";
								$pagesize = 10; // 分页数量
								$pageval = chkstr(trim($_REQUEST['page'])); // 获取Page的值
								if($pageval){
									if(!is_numeric($pageval)){
										echo erro("Page Error");
									}
									if($pageval <= 1){
										$pageval = 1;
									}
									$page = ($pageval-1) * $pagesize;
									$page .= ",";
								}else{
									$pageval = 1;
								}
								
								$pagesql = "select * from kboy_forum_travel where uid=$uid order by id desc";
								$pagenum = mysql_num_rows(mysql_query($pagesql)); // 总记录数
								$pagecount = ceil($pagenum/$pagesize); // 共分多少页
								if($pageval > $pagecount){
									$pageval = $pagecount;
								}
								
								$news_sql = $pagesql." limit $page $pagesize";
								$news_rows = mysql_query($news_sql);
								$i = 1;
								while($news_rs = mysql_fetch_array($news_rows)){
						?>
						
                            <div class="sq-travel-item">
                                <dl>
                                    <dt><a href="forum_travelview.php?newsid=<?=$news_rs['id']?>" target="_blank"><img src="<?=$news_rs['travel_pic']?>" width="205" height="150" alt=""/></a></dt>
                                    <dd>
                                        <div class="sq-travel-in">
                                            <h3 class="title"><a href="forum_travelview.php?newsid=<?=$news_rs['id']?>" target="_blank"><?=$news_rs['travel_title']?></a>
                                            	<?php
														if($kboy_userid == $uid){
												?>
												<a style="float: right;" href="forum_travel_edit.php?uid=<?=$uid?>&id=<?=$news_rs['id']?>">修改</a>
												<?php
														}
												?>
                                            </h3>
                                            <div class="editor-inner">
                                                <span class="editor">作者：<a href="forum_travelview.php?newsid=<?=$news_rs['id']?>" target="_blank"><?=getUserNickName($news_rs['uid'])?></a></span>
                                                <span class="date"><?=date('Y-m-d',strtotime($news_rs['travel_addtime']))?></span>
                                                <div class="show-pl"><span class="watch"><i></i><?=$news_rs['travel_hit']?></span><span class="pl"></span><span class="good click_sc" mid="<?=$news_rs['id']?>"><i></i><?=$news_rs['travel_best']?></span></div>
                                            </div>
                                            <div class="sq-t-detail">
                                                <a href="forum_travelview.php?newsid=<?=$news_rs['id']?>" target="_blank"><?=$news_rs['travel_content']?></a>&nbsp;&nbsp;
                                            </div>
                                        </div>
                                    </dd>
                                </dl>
                            </div>
						<?php
								} // while 完毕
						?>
                        </div>
						<?php
								if($pagenum > $pagesize){
									echo "<div class=\"pagination\"><ul>";
									$url = "forum_travel.php?uid=$uid";//当前页面
									pagebar($pagecount, $pageval, 7, $url);
									echo "</ul></div>";
								}
						?>
                    </div>
                </div>
				
				
				<? include("_include.forum.right.php") ?>
				
				
            </div>
        </div>
    </div>
    <!--foot begin-->
	<? include("_include.bottom.footbar.php") ?>
    <!--foot begin-->
    <!--左侧悬浮 begin-->
	<? include("_include.bottom.leftbar.php") ?>
    <!--左侧悬浮 end-->
    <!--右侧悬浮导航 begin-->
	<? include("_include.bottom.rightbar.php") ?>
    <!--右侧悬浮导航 end-->
    <script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="js/jquery.SuperSlide.2.1.1.js"></script>
    <script type="text/javascript" src="js/main.js"></script>
    <script type="text/javascript" src="js/sq.js"></script>
</body>
</html>

